<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<style type="text/css">
			
		</style>
	</head>
	<body>
		<div id="app">
			{{msg}}
			-
			{{sum1}}
			-
			{{sum2()}}
		</div>
	</body>
	<script src="../vue.js" type="text/javascript" charset="utf-8"></script>
	<script type="text/javascript">
			
		new Vue({
			el:"#app",
			data:{
				numArr:[3,4,5,6,7],
				msg:"hello",
			},
			computed:{
				sum1(){
					return this.numArr
							.reduce((prev,next)=>{
						return prev + next;
					},0)
				}
			},
			methods:{
				sum2(){
					return this.numArr
							.reduce((prev,next)=>{
						return prev + next;
					},0)
				}
			}
		})
		
	</script>
</html>
